Implement Email Verification Flow - #39
Conversation
- Replace auto-verification with `is_verified=False` by default. - Add `verification_token` and `verification_token_expires` to `User` model. - Create `EmailService` with support for SMTP and console (mock) backends. - Update `register` endpoint to generate token and send email. - Add `/verify-email` and `/resend-verification` endpoints. - Update `update_db.py` to add new columns to `users` table. - Fix `WeatherHistory` model to be compatible with SQLite (use `Uuid` instead of `postgresql.UUID`). - Add tests for email verification flow using in-memory SQLite. - Update `requirements.txt` with necessary dependencies (`aiosqlite`, `email-validator`, pinned `bcrypt`). Co-authored-by: singhaditya21 <53948039+singhaditya21@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Reviewed, leaving open — needs a rebase, and one part of it has already landed differently.
Also worth knowing:
|
Implemented a complete email verification flow for the backend API.
Changes include:
verification_tokenandverification_token_expirescolumns touserstable. UpdatedWeatherHistorymodel to use genericUuidfor SQLite compatibility during testing.config.py.EmailServiceto handle email sending (supports console logging for dev/test and SMTP for production).registerendpoint to create unverified users and send verification emails. Addedverify_emailendpoint to validate tokens. Addedresend_verificationendpoint.conftest.pywith async SQLite fixture andtest_email_verification.pycovering the full flow.aiosqlite,email-validatorand pinnedbcrypt==3.2.2torequirements.txt.PR created automatically by Jules for task 12296771320430789151 started by @singhaditya21